<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body {
        background-color: darkslategray;
    }
    
    .div {
        width: 500px;
        height: 200px;
        border: 2px black solid;
        margin: 0 auto;
        background-color: floralwhite;
        /*盒子居中*/
    }
    
    .center {
        text-align: center;
    }
    
    .fount {
        font-size: 30px;
        color: darkorange;
        margin-left: 15%;
    }
</style>

<body>
    <div class="div">
        <h2 class="center">提交成功</h2>
        <span class="fount">3</span><span></span>
        <a href="javascript:;">秒后系统会自动跳转，也可单击此链接进行跳转</a></span>
    </div>
</body>
<script>
    var flag = 3;
    var num = document.querySelector('.fount');
    var a = document.querySelector('a');
    a.onclick = function() {
        location = "http://www.baidu.com";
    }
    console.log(num);
    setInterval(function() {
        flag--;
        num.innerHTML = flag;
        if (flag == 0) {
            clearInterval;
        }
    }, 1000);
    setTimeout(function() {
        location = "http://www.baidu.com";
    }, 3000);
</script>

</html>